<HTML>
<HEAD>

<script type="text/javascript" src="/yui/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="/yui/build/event/event-min.js" ></script>
<script type="text/javascript" src="/yui/build/dom/dom-min.js" ></script>
<script type="text/javascript" src="/yui/build/connection/connection-min.js"></script>
<script type="text/javascript" src="/yui/build/json/json-debug.js"></script>
<!-- The Portals Namespace -->
<script type="text/javascript" src="/2112PowerWindows/config/portalSettings.js"></script>   
<script type="text/javascript"  src="/2112PowerWindows/runtime12/NS2112.js"></script>
<script type="text/javascript"  src="/2112PowerWindows/runtime12/portalPersister.js"></script>
<script type="text/javascript">


var callbacks = { 
	    // Successful XHR response handler 
	    success : function (o) { 
	        var messages = []; 
	 
	        // Use the JSON Utility to parse the data returned from the server 
	        try { 
	            messages = YAHOO.lang.JSON.parse(o.responseText); 
	        } 
	        catch (x) { 
	            alert("JSON Parse failed!"); 
	            return; 
	        } 
	 
	        // The returned data was parsed into an array of objects. 
	        // Add a P element for each received message 
	        for (var i = 0, len = messages.length; i < len; ++i) { 
	            var m = messages[i]; 
	            var p = document.createElement('p'); 
	            var message_text = document.createTextNode( 
	                    m.animal + ' says "' + m.message + '"'); 
	            p.appendChild(message_text); 
	            msg_section.appendChild(p); 
	        } 
	    } 
	 
	    
	}; 
	 
	

myPortalCallback = function(responseObject)
 {
   alert("ready") ;
      
 }
var rLayout = [ 
               {Name: "left", XPos:"2", YPos: "110", Width: "200", Height: "800"},
               {Name: "center", XPos:"205", YPos: "110", Width: "600", Height: "250"},
               //{Name: "right", XPos:"RightMost", YPos: "110", Width: "600", Height: "250"},
               {Name: "top", XPos:"0", YPos: "0", Width: "1200", Height: "100", Layout: "brick"}
              ];

testPersister = function ()
{
	var p = new NS2112.stdPersister('veri', myPortalCallback) ;
	// Make the call to the server for JSON data 
	//YAHOO.util.Connect.asyncRequest('GET',"/xmlProviders/jsonProvider.php", callbacks); 
	//NS2112.stdPersister.selfTest() ;
	//p.load() ;  //this would trigger our callback
	alert(YAHOO.lang.JSON.stringify(rLayout)) ;
}


</script>

<META NAME="GENERATOR" Content="2112Portals">
<TITLE>Portal Persister Testbox</TITLE>
</HEAD>
<BODY>

<button id="show" onclick="testPersister()">Test</button>

</BODY>
</HTML>
